#!/usr/bin/env python
#-*- coding:utf-8 -*-

import gtk


progressBar = None


def progresso_configura(_progressBar):
    
    global progressBar
    progressBar = _progressBar



def progresso_run( porcent ):
    
    global progressBar

    if porcent >= 1.0:
        progressBar.hide()
    else:
        if not progressBar.get_property( "visible" ):
            progressBar.show()

    progressBar.set_fraction( porcent )
    gtk.main_iteration( block = False )

    #manda processar as mensagens pendentes da GUI   
    #while gtk.events_pending():
    #    gtk.main_iteration( block = False )

